import logging

from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from portal import model
from portal.lib.base import BaseController, render

log = logging.getLogger(__name__)

class EvenementController(BaseController):

    def index(self):
        q = model.Session.query(model.Evenement)
        c.evenements = q.limit(20)
        
        return render('/evenement/evenement.mako')
        
    
    def view(self, param = None):
        q = model.Session.query(model.Evenement).filter(model.Evenement.id == param)
        c.evenements = q.first()

        return render('/evenement/evenement_view.mako')